export default {
  data() {
    return {
      searchItem: {
        searchKey: "",
      },
      columns: [
        {
            title: "通行图片",
            align: 'center',
            slot: "pictureurl",
        },
        {
          title: "姓名",
          key: "name",
          fixed: "left",
          width: 150,
        },
        {
          title: "工号",
          key: "employeeno",
          align: "center",
        },
        {
          title: "设备",
          key: "ip",
          align: "center",
        },
        {
          title: "时间",
          key: "datetime",
          align: "center",
        },
      ],
      total: 0,
      page: 1,
      pageSize: 10,
      list: [],
    };
  },
  computed: {
    user() {
      return this.$store.state.user;
    },
  },
  methods: {
    pageChange(page) {
      this.page = page;
      this.getData();
    },
    pageSizeChange(pageSize) {
      this.pageSize = pageSize;
      this.getData();
    },
    getData() {
      this.$axios({
        url: `/record/pass`,
        method: "POST",
        data: {
          page: this.page,
          pageSize: this.pageSize,
          searchKey: this.searchItem.searchKey,
        },
      }).then((res) => {
        if (res.code == 200) {
          this.list = res.data.list;
          this.total = res.data.total;
        }
      });
    },
  },
  created() {
    this.getData();
  },
};
